package ex1.game.players;

import ex1.game.Action;
import ex1.game.Player;
import ex1.game.PrisonersDilemmaGame;

public class TitForTatPlayer implements Player {

	@Override
	public Action playGame(PrisonersDilemmaGame game,
			Action otherPlayerLastAction) {
		
		if(otherPlayerLastAction == null)
		{
			return Action.Cooperate;
		}
		else
		{
			return otherPlayerLastAction;
		}
	}
	
	@Override
	public String toString()
	{
		return "TitForTatPlayer";
	}

}
